<?php
$client = stream_socket_client(
    'tcp://127.0.0.1:9001', $errno, $errstr);

if (!$client) {
    echo $errstr . PHP_EOL;
    exit;
}

/*Swoole\Event::add($client, function($fp) {
    $resp = fread($fp, 8192);
    //socket处理完成后，从epoll事件中移除socket
    swoole_event_del($fp);
    fclose($fp);

    print_r($resp . PHP_EOL);
});*/

echo "Finish\n";  //Swoole\Event::add 不会阻塞进程，这行代码会顺序执行